package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum AreaLevel {
	
	ZERO(0,"省级"),
	ONE(1,"市级"),
	TWO(2,"县级"),
	THREE(3,"镇级"),
	FOUR(4,"乡村级");
	
	private Integer value;
	private String text;

	private AreaLevel(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public int toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static AreaLevel toTypeLevel(int value) {
		for (AreaLevel level : values()) {
			if(level.toIntValue() == value) {
				return level;
			}
		}
		throw new InvalidArgumentException("Unknown TypeLevel[" + value + "].");
	}
}
